package com.hisense.ovcloud.commons.tools;

import org.apache.commons.codec.binary.Hex;

import java.util.Random;

public class DkeyTool {
    public static String generateRandomKey(int length){
        var byteArr = new byte[length];
        for(int i = 0; i < length; i++){
            byteArr[i] = (byte)(new Random().nextInt(256));
        }
        return Hex.encodeHexString(byteArr);
    }

    public static void main(String[] args) {
        System.out.println(generateRandomKey(16));
    }
}
